package com.pacai.Method;

public class MethodParameter02 {
    public static void main(String[] args) {
        Person1 person1 = new Person1();
        person1.name = "John";
        person1.age = 18;
        int[] arr = {1,2,3,4,5};
        B1 b1 = new B1();
        b1.test2(person1);
        System.out.println(person1.name + person1.age);
        b1.test3(arr);
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + " ");
        }
    }

}

class Person1{
    String name;
    int age;
}

class B1{
    public void test2(Person1 p){
        p = new Person1();
        p.name = "tom";
        p.age = 99;
        p = null;
    }

    public void test3(int[] arr){
        arr[0] = 200;
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + " ");
        }
    }
}


